package com.xncoding.design.proAcus.demo1;

import java.util.ArrayList;

public class subject implements demoSubject {
	
	public ArrayList<demoObserver> observer = new ArrayList<demoObserver>();
	
	@Override
	public void addUser(demoObserver obj) {
		observer.add(obj);
	}

	@Override
	public void removeUser(demoObserver obj) {
		observer.remove(obj);
	}

	@Override
	public void dataChange(String str) {
		for(int i=0,len=observer.size();i<len;i++)
		{
			observer.get(i).demoUpdate(str);;
		}
	}
}
